package com.ruoyi.quartz.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.quartz.mapper.YmdCgBaseMapper;
import com.ruoyi.quartz.domain.YmdCgBase;
import com.ruoyi.quartz.service.IYmdCgBaseService;

/**
 * 种球订单汇总Service业务层处理
 * 
 * @author SYF
 * @date 2025-05-09
 */
@Service
public class YmdCgBaseServiceImpl implements IYmdCgBaseService 
{
    @Autowired
    private YmdCgBaseMapper ymdCgBaseMapper;

    /**
     * 查询种球订单汇总
     * 
     * @param xdCycle 种球订单汇总主键
     * @return 种球订单汇总
     */
    @Override
    public YmdCgBase selectYmdCgBaseByXdCycle(String xdCycle)
    {
        return ymdCgBaseMapper.selectYmdCgBaseByXdCycle(xdCycle);
    }

    /**
     * 查询种球订单汇总列表
     * 
     * @param ymdCgBase 种球订单汇总
     * @return 种球订单汇总
     */
    @Override
    public List<YmdCgBase> selectYmdCgBaseList(YmdCgBase ymdCgBase)
    {
        return ymdCgBaseMapper.selectYmdCgBaseList(ymdCgBase);
    }

    /**
     * 新增种球订单汇总
     * 
     * @param ymdCgBase 种球订单汇总
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVEDM)
    public int insertYmdCgBase(YmdCgBase ymdCgBase)
    {
        return ymdCgBaseMapper.insertYmdCgBase(ymdCgBase);
    }

    /**
     * 修改种球订单汇总
     * 
     * @param ymdCgBase 种球订单汇总
     * @return 结果
     */
    @Override
    public int updateYmdCgBase(YmdCgBase ymdCgBase)
    {
        return ymdCgBaseMapper.updateYmdCgBase(ymdCgBase);
    }

    /**
     * 批量删除种球订单汇总
     * 
     * @param xdCycles 需要删除的种球订单汇总主键
     * @return 结果
     */
    @Override
    public int deleteYmdCgBaseByXdCycles(String[] xdCycles)
    {
        return ymdCgBaseMapper.deleteYmdCgBaseByXdCycles(xdCycles);
    }

    /**
     * 删除种球订单汇总信息
     * 
     * @param xdCycle 种球订单汇总主键
     * @return 结果
     */
    @Override
    public int deleteYmdCgBaseByXdCycle(String xdCycle)
    {
        return ymdCgBaseMapper.deleteYmdCgBaseByXdCycle(xdCycle);
    }

    @Override
    @DataSource(DataSourceType.SLAVEDM)
    public int deleteYmdCgBaseByPreDate(String year){
        return ymdCgBaseMapper.deleteYmdCgBaseByPreDate(year);
    }
}
